package com.hjw.inheritance.junit;

import com.hjw.inheritance.exer2.*;

import java.util.Random;

/**
 * @author hjwStrart
 * @create 2022-01-12 18:37
 */
public class TestPet {
    public static void main(String[] args) {
        Master master = new Master();
        Pet pet = null;
        Random random = new Random();
        int i = random.nextInt(2) + 1;
        switch (i){
            case 1 : pet = new Dog();break;
            case 2 : pet = new Cat();break;
            default:break;
        }
        master.feed(pet);
    }
}
